class TemporalDischargesController < ApplicationController
  
  # GET /temporal_discharges
  # GET /temporal_discharges.xml
  def index
    @temporal_discharges = TemporalDischarge.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @temporal_discharges }
    end
  end

  # GET /temporal_discharges/1
  # GET /temporal_discharges/1.xml
  def show
    @temporal_discharge = TemporalDischarge.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @temporal_discharge }
    end
  end

  # GET /temporal_discharges/new
  # GET /temporal_discharges/new.xml
  def new
    @temporal_discharge = TemporalDischarge.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @temporal_discharge }
    end
  end

  # GET /temporal_discharges/1/edit
  def edit
    @temporal_discharge = TemporalDischarge.find(params[:id])
  end

  # POST /temporal_discharges
  # POST /temporal_discharges.xml
  def create
    @temporal_discharge = TemporalDischarge.new(params[:temporal_discharge])

    respond_to do |format|
      if @temporal_discharge.save
        flash[:notice] = 'TemporalDischarge was successfully created.'
        format.html { redirect_to(@temporal_discharge) }
        format.xml  { render :xml => @temporal_discharge, :status => :created, :location => @temporal_discharge }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @temporal_discharge.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /temporal_discharges/1
  # PUT /temporal_discharges/1.xml
  def update
    @temporal_discharge = TemporalDischarge.find(params[:id])

    respond_to do |format|
      if @temporal_discharge.update_attributes(params[:temporal_discharge])
        flash[:notice] = 'TemporalDischarge was successfully updated.'
        format.html { redirect_to(@temporal_discharge) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @temporal_discharge.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /temporal_discharges/1
  # DELETE /temporal_discharges/1.xml
  def destroy
    @temporal_discharge = TemporalDischarge.find(params[:id])
    @temporal_discharge.destroy

    respond_to do |format|
      format.html { redirect_to(temporal_discharges_url) }
      format.xml  { head :ok }
    end
  end
end
